import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/xquant";

// 查询用户权限
export function listUserPerm(query) {
  return request({
    url: '/system/userPerm/list',
    method: 'get',
    params: query
  })
}

// 查询用户权限详细
export function getUserPerm(userId) {
  return request({
    url: '/system/userPerm/' + parseStrEmpty(userId),
    method: 'get'
  })
}

// 查询用户账户权限详细
export function getUserPermDetail(query) {
  return request({
    url: '/system/userPerm/userAccDetailPerm.action',
    method: 'post',
    data: query
  })
}
//查询用户组合权限详细
export function userGroupDetailPerm(query) {
  return request({
    url: '/system/userPerm/userGroupDetailPerm.action',
    method: 'post',
    data: query
  })
}
// 查询用户利率详细
export function userIrcDetailPerm(query) {
  return request({
    url: '/system/userPerm/userIrcDetailPerm.action',
    method: 'post',
    data: query
  })
}

// 查询用户红利权限详细
export function userDivDetailPerm(query) {
  return request({
    url: '/system/userPerm/userDivDetailPerm.action',
    method: 'post',
    data: query
  })
}

// 查询用户波动率权限详细
export function userVlsDetailPerm(query) {
  return request({
    url: '/system/userPerm/userVlsDetailPerm.action',
    method: 'post',
    data: query
  })
}

// 查询用户定价配置权限详细
export function userCfgDetailPerm(query) {
  return request({
    url: '/system/userPerm/userCfgDetailPerm.action',
    method: 'post',
    data: query
  })
}

// 新增用户权限
export function addUserPerm(data) {
  return request({
    url: '/system/userPerm',
    method: 'post',
    data: data
  })
}

// 修改用户权限
export function updateUserPerm(data) {
  return request({
    url: '/system/userPerm',
    method: 'put',
    data: data
  })
}


// 删除用户权限
export function delUserPerm(userId) {
  return request({
    url: '/system/userPerm/' + userId,
    method: 'delete'
  })
}

// 修改用户权限
export function updateUserAccPerm(data) {
  return request({
    url: '/system/userPerm/edtUserAccPerm.action',
    method: 'get',
    params: data
  })
}


// 修改用户组合权限
export function updateUserGroupPerm(data) {
  return request({
    url: '/system/userPerm/edtUserGroupPerm.action',
    method: 'get',
    params: data
  })
}

// 修改用户配置权限
export function updateUserCfgPerm(data) {
  return request({
    url: '/system/userPerm/edtUserCfgPerm.action',
    method: 'get',
    params: data
  })
}

// 修改用户利率权限
export function updateUserIrcPerm(data) {
  return request({
    url: '/system/userPerm/edtUserIrcPerm.action',
    method: 'get',
    params: data
  })
}

// 修改用户红利权限
export function updateUserDivPerm(data) {
  return request({
    url: '/system/userPerm/edtUserDivPerm.action',
    method: 'get',
    params: data
  })
}

// 修改用户波动率权限
export function updateUserVlsPerm(data) {
  return request({
    url: '/system/userPerm/edtUserVlsPerm.action',
    method: 'get',
    params: data
  })
}
